package global

import (
	"github.com/Sir-yuChen/funAnalyse/model"
)

// 构造函数
func SetDefinitionApi(apiName string, apiPath string, basePath string,
	apiType string, apiFunction string, status string) *model.StockApiResource {
	return &model.StockApiResource{
		ApiName:     apiName,
		ApiPath:     apiPath,
		BasePath:    basePath,
		ApiType:     apiType, //GET PUT POST DELETE ...
		ApiFunction: apiFunction,
		Status:      status,
	}
}

//定义路由分组
var (
	ROUTER_GROUP_USER   = "user"
	ROUTER_GROUP_CASBIN = "casbin"
	ROUTER_GROUP_COMMON = "common"
	ROUTER_GROUP_MENU   = "menu"
	ROUTER_GROUP_SYSTEM = "system"
	ROUTER_GROUP_MSG    = "newsletter"
	ROUTER_GROUP_FILE   = "files"
)

//定义接口请求路径
var (
	//生成接口文档
	API_SWAGGER = SetDefinitionApi("swagger接口文档", "/swagger/*any", "", "GET", "生成接口文档", "Y")
	//系统健康监测
	API_HEALTH = SetDefinitionApi("系统健康监测接口", "/funAnalyse/health", "health", "GET", "系统健康监测", "Y")
	//Holle
	API_HELLO = SetDefinitionApi("hello", "/funAnalyse/hello", "hello", "GET", "hello", "Y")
	//登录
	API_USERLOGIN = SetDefinitionApi("登录", "/funAnalyse/user/userLogin", "userLogin", "POST", "登录流程接口", "Y")
	//注册
	API_USERREGISTER = SetDefinitionApi("注册", "/funAnalyse/user/userRegister", "userRegister", "POST", "注册流程接口", "Y")
	//获取用户信息
	API_USERINFO = SetDefinitionApi("获取用户信息", "/funAnalyse/user/getUserInfo", "getUserInfo", "GET", "根据用户ID获取用户详情", "Y")
	//查用户集合
	API_USER_LIST = SetDefinitionApi("查用户集合", "/funAnalyse/user/getUserList", "getUserList", "GET", "查用户集合", "Y")
	//修改手机号/密码
	API_UPDATE_USERINFO = SetDefinitionApi("修改手机号/密码", "/funAnalyse/user/upateUserInfo", "upateUserInfo", "POST", "", "Y")
	//退登
	API_USER_LOGIN_OUT = SetDefinitionApi("退登", "/funAnalyse/user/userLoginOut", "userLoginOut", "GET", "", "Y")
	//获取验证码
	API_VERIFICATION = SetDefinitionApi("获取验证码", "/funAnalyse/common/verification", "verification", "GET", "获取验证码", "Y")
	//校验验证码
	API_CHECVERIFICATION = SetDefinitionApi("校验验证码", "/funAnalyse/common/checkVerification", "checkVerification", "GET", "校验验证码", "Y")
	//代码生成器
	API_AUTO_CODE = SetDefinitionApi("代码生成器", "/funAnalyse/common/autoCode", "autoCode", "GET", "代码生成器", "Y")
	//获取接口资源
	API_API_RESOURCE = SetDefinitionApi("获取接口资源", "/funAnalyse/common/getStockApiResource", "getStockApiResource", "GET", "获取接口资源", "Y")
	//获取表结构信息
	API_Table_Structure = SetDefinitionApi("获取表结构信息", "/funAnalyse/common/getStockTableStructure", "getStockTableStructure", "GET", "获取表结构信息", "Y")

	API_CASBIN_ROLE_GET    = SetDefinitionApi("get角色", "/funAnalyse/casbin/getCasbinRole", "getCasbinRole", "GET", "获取角色", "Y")
	API_CASBIN_ROLE_INSERT = SetDefinitionApi("inster角色", "/funAnalyse/casbin/insertCasbinRole", "insertCasbinRole", "POST", "", "Y")
	API_CASBIN_ROLE_UPDATE = SetDefinitionApi("update角色", "/funAnalyse/casbin/updateCasbinRole", "updateCasbinRole", "POST", "", "Y")
	API_CASBIN_ROLE_DEL    = SetDefinitionApi("del角色", "/funAnalyse/casbin/delCasbinRole", "delCasbinRole", "GET", "", "N")

	API_CASBIN_ROLE_RELATION_RESOURCES_GET    = SetDefinitionApi("get角色资源关系", "/funAnalyse/casbin/getCasbinRoleRelationResources", "getCasbinRoleRelationResources", "GET", "", "Y")
	API_CASBIN_ROLE_RELATION_RESOURCES_INSERT = SetDefinitionApi("inster角色资源关系", "/funAnalyse/casbin/insertCasbinRoleRelationResources", "insertCasbinRoleRelationResources", "POST", "", "Y")
	API_CASBIN_ROLE_RELATION_RESOURCES_UPDATE = SetDefinitionApi("update角色资源关系", "/funAnalyse/casbin/updateCasbinRoleRelationResources", "updateCasbinRoleRelationResources", "POST", "", "Y")
	API_CASBIN_ROLE_RELATION_RESOURCES_DEL    = SetDefinitionApi("del角色资源关系", "/funAnalyse/casbin/delCasbinRoleRelationResources", "delCasbinRoleRelationResources", "GET", "", "N")
	API_CASBIN_ROLE_RESOURCES_ASSIGNING       = SetDefinitionApi("分配资源", "/funAnalyse/casbin/assigningResources", "assigningResources", "GET", "", "Y")

	API_CASBIN_ROLE_RELATION_USER_GET    = SetDefinitionApi("get用户角色关系", "/funAnalyse/casbin/getCasbinRoleRelationUser", "getCasbinRoleRelationUser", "GET", "", "Y")
	API_CASBIN_ROLE_RELATION_USER_INSERT = SetDefinitionApi("inster用户角色关系", "/funAnalyse/casbin/insertCasbinRoleRelationUser", "insertCasbinRoleRelationUser", "POST", "", "Y")
	API_CASBIN_ROLE_RELATION_USER_UPDATE = SetDefinitionApi("update用户角色关系", "/funAnalyse/casbin/updateCasbinRoleRelationUser", "updateCasbinRoleRelationUser", "POST", "", "Y")
	API_CASBIN_ROLE_RELATION_USER_DEL    = SetDefinitionApi("del用户角色关系", "/funAnalyse/casbin/delCasbinRoleRelationUser", "delCasbinRoleRelationUser", "GET", "", "N")
	API_CASBIN_ROLE_USER_ASSIGNINGROLE   = SetDefinitionApi("分配角色", "/funAnalyse/casbin/assigningRole", "assigningRole", "POST", "", "Y")
	//部门
	API_CASBIN_Dept_GET    = SetDefinitionApi("get", "/funAnalyse/casbin/getCasbinDept", "getCasbinDept", "GET", "", "Y")
	API_CASBIN_Dept_INSERT = SetDefinitionApi("inster", "/funAnalyse/casbin/insertCasbinDept", "insertCasbinDept", "POST", "", "Y")
	API_CASBIN_Dept_UPDATE = SetDefinitionApi("update", "/funAnalyse/casbin/updateCasbinDept", "updateCasbinDept", "POST", "", "Y")
	API_CASBIN_Dept_DEL    = SetDefinitionApi("del", "/funAnalyse/casbin/delCasbinDept", "delCasbinDept", "GET", "", "N")
	//菜单
	API_Menu_GET    = SetDefinitionApi("get菜单", "/funAnalyse/menu/getMenuInfo", "getMenuInfo", "GET", "", "Y")
	API_Menu_INSERT = SetDefinitionApi("inster菜单", "/funAnalyse/menu/insertMenu", "insertMenu", "POST", "", "Y")
	API_Menu_UPDATE = SetDefinitionApi("update菜单", "/funAnalyse/menu/updateMenuInfo", "updateMenuInfo", "POST", "", "Y")
	API_Menu_DEL    = SetDefinitionApi("del菜单", "/funAnalyse/menu/delMenu", "delMenu", "GET", "", "N")
	API_Menu_Tree   = SetDefinitionApi("菜单树", "/funAnalyse/menu/getMenuTree", "getMenuTree", "GET", "", "Y")

	//系统监控
	API_SYS_MONITER = SetDefinitionApi("系统监控信息收集", "/funAnalyse/system/sysMoniter", "sysMoniter", "GET", "", "Y")

	//  公告
	API_MSG_Bulletin_GET    = SetDefinitionApi("获取公告[条件]", "/funAnalyse/newsletter/getStockBulletin", "getStockBulletin", "GET", "", "Y")
	API_MGS_Bulletin_INSERT = SetDefinitionApi("新增公告", "/funAnalyse/newsletter/insertStockBulletin", "insertStockBulletin", "POST", "", "Y")
	API_MSG_Bulletin_UPDATE = SetDefinitionApi("修改公告", "/funAnalyse/newsletter/updateStockBulletin", "updateStockBulletin", "POST", "", "Y")
	API_MSG_Bulletin_DEL    = SetDefinitionApi("删除公告", "/funAnalyse/newsletter/delStockBulletin", "delStockBulletin", "GET", "", "N")

	//聊天私信功能
	API_USER_COMMUNICATION_BASIS      = SetDefinitionApi("获取用户通讯录&聊天室信息", "/funAnalyse/newsletter/getCommunicationBasis", "getCommunicationBasis", "GET", "", "Y")
	API_USER_COMMUNICATION_FRIEND_ADD = SetDefinitionApi("新增用户通讯录请求", "/funAnalyse/newsletter/addCommunicationFriend", "addCommunicationFriend", "GET", "", "Y")
	API_USER_FRIEND_ADD               = SetDefinitionApi("新增用户通讯录", "/funAnalyse/newsletter/addFriend", "addFriend", "GET", "", "Y")
	API_CHAT_CREATE_ROOM              = SetDefinitionApi("创建聊天室", "/funAnalyse/newsletter/createChatroom", "createChatroom", "GET", "", "Y")
	API_CHAT_CREATE_WEBSOCKET         = SetDefinitionApi("创建长连接", "/funAnalyse/newsletter/createWebsocket", "createWebsocket", "GET", "", "Y")
	API_CHAT_SEND_MSG                 = SetDefinitionApi("发送消息", "/funAnalyse/newsletter/sendCommunicationMsg", "sendCommunicationMsg", "GET", "", "Y")
	API_UPDATE_FRIEND_INFO            = SetDefinitionApi("修改好友信息", "/funAnalyse/newsletter/updateFriendInfo", "updateFriendInfo", "POST", "", "Y")
	API_UPDATE_BASIS_ROOM_INFO        = SetDefinitionApi("修改聊天室信息", "/funAnalyse/newsletter/updateBasisRoomInfo", "updateBasisRoomInfo", "POST", "", "Y")
	API_READ_CHAT_MSG                 = SetDefinitionApi("读取聊天室信息", "/funAnalyse/newsletter/readChatroomMsg", "readChatroomMsg", "GET", "", "Y")

	//公告与用户群
	API_MSG_Bulletin_Group_GET    = SetDefinitionApi("获取公告与用户群关系[条件]", "/funAnalyse/newsletter/getStockUserGroup", "getStockUserGroup", "GET", "", "Y")
	API_MGS_Bulletin_Group_INSERT = SetDefinitionApi("新增公告与用户群关系", "/funAnalyse/newsletter/insertStockUserGroup", "insertStockUserGroup", "POST", "", "Y")
	API_MSG_Bulletin_Group_UPDATE = SetDefinitionApi("修改公告与用户群关系", "/funAnalyse/newsletter/updateStockUserGroup", "updateStockUserGroup", "POST", "", "Y")
	API_MSG_Bulletin_Group_DEL    = SetDefinitionApi("删除公告与用户群关系", "/funAnalyse/newsletter/delStockUserGroup", "delStockUserGroup", "GET", "", "N")
	//文件
	API_Files_GET      = SetDefinitionApi("查询上传文件详情", "/funAnalyse/files/getOneFileInfo", "getOneFileInfo", "GET", "", "Y")
	API_Files_INSERT   = SetDefinitionApi("上传文件", "/funAnalyse/files/uploadFile", "uploadFile", "POST", "", "Y")
	API_Files_UPDATE   = SetDefinitionApi("修改已上传文件信息", "/funAnalyse/files/updateFileInfo", "updateFileInfo", "POST", "", "Y")
	API_Files_DEL      = SetDefinitionApi("删除已上传文件", "/funAnalyse/files/delFile", "delFile", "GET", "", "Y")
	API_Files_Download = SetDefinitionApi("文件下载", "/funAnalyse/files/downloadFile", "downloadFile", "GET", "", "Y")
)
